package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description 商品信息
 */
public interface GoodsDao {

    //获取当前商品最大编码
    String getMaxCode();


    List<Goods> getGoodsInventoryList(@Param("offSet")Integer offSet, @Param("rows")Integer rows, @Param("codeOrName")String codeOrName, @Param("goodsTypeId")Integer goodsTypeId);

    Integer getGoodsInventoryCount(@Param("codeOrName")String codeOrName, @Param("goodsTypeId")Integer goodsTypeId);

    List<Goods> getGoodsList(@Param("offSet")Integer offSet, @Param("rows")Integer rows, @Param("goodsName")String goodsName, @Param("goodsTypeId")Integer goodsTypeId);

    Integer getGoodsCount(@Param("goodsName")String goodsName, @Param("goodsTypeId")Integer goodsTypeId);

    void updateGoods(Goods goods);

    void saveGoods(Goods goods);

    void deleteGoods(Integer goodsId);

    Goods selectOneGood(Integer goodsId);

    List<Goods> getNoInventoryQuantityList(@Param("offSet") Integer offSet, @Param("rows") Integer rows,@Param("nameOrCode") String nameOrCode);

    Integer getNoInventoryQuantityCount(@Param("nameOrCode") String nameOrCode);

    List<Goods> getHasInventoryQuantityList(@Param("offSet") Integer offSet, @Param("rows") Integer rows,@Param("nameOrCode") String nameOrCode);

    Integer getHasInventoryQuantityCount(@Param("nameOrCode") String nameOrCode);

    void updateStock(Integer goodsId, Integer inventoryQuantity, double purchasingPrice);

    List<Goods> selectListAlarm();
}
